package com.slot.faraohgoldview;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;

public class BtmPanel extends View {

	private Bitmap mBPanel;
	public float scaleY;
	private Paint paint;

	public BtmPanel(Context context) {
		super(context);
		
		paint=new Paint();
		mBPanel=BitmapFactory.decodeResource(context.getResources(), R.drawable.bpanel);
	}
	
	@Override
    protected void onSizeChanged(int width, int height, int oldw, int oldh) {
		scaleY = (float) height/480;
		mBPanel = Bitmap.createScaledBitmap(
    			mBPanel, width, (int) (209 * scaleY), true);
	}
	
	@Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        
        canvas.drawBitmap(mBPanel,0,scaleY, paint);
	}
	
	public void setAlpha(int alpha){
		paint.setAlpha(alpha);
		invalidate();
	}
	
}
